#!/bin/bash
####################################################################
# Prey Session Module - by Tomas Pollak (bootlog.org)
# URL : http://preyproject.com
# License: GPLv3
####################################################################

log " -- Getting current logged in user name..."
add_trace logged_user $logged_user

log "$STRING_UPTIME_AND_PROCESS"
get_uptime
add_trace uptime "$uptime"

if [ "$session__get_running_programs" == 'y' ]; then
	get_running_programs
	add_trace running_programs "$running_programs"
fi

if [ "$session__get_modified_files" == 'y' ]; then
	locate_path
	log "$STRING_MODIFIED_FILES"
	get_modified_files
	if [ -n "$modified_files" ]; then
		add_trace modified_files "$modified_files"
	else
		log ' !! Nothing found. Make sure you type in a valid path.'
	fi
fi

if [ "$session__get_screenshot" == 'y' ]; then
	log "$STRING_GET_SCREENSHOT"
	get_screenshot
	if [ -f "$session__screenshot" ]; then
		add_file screenshot "$session__screenshot"
	fi
fi
